//
//  PGPopoverView.h
//  PopoverViewDemo
//
//  Created by Pill Gong on 14-2-26.
//  Copyright (c) 2014年 Pill Gong. All rights reserved.
//

#import <UIKit/UIKit.h>

#define PGPopTitleHeight 44.0f


@class PGPopoverView;

@protocol PGPopoverViewDataSource <NSObject>
@required

- (UITableViewCell *)popoverView:(PGPopoverView *)popoverView
                    cellForIndexPath:(NSIndexPath *)indexPath;

- (NSInteger)popoverView:(PGPopoverView *)popoverView
       numberOfRowsInSection:(NSInteger)section;

@end

@protocol PGPopoverViewDelegate <NSObject>
@optional

- (void)popoverView:(PGPopoverView *)popoverView
     didSelectIndexPath:(NSIndexPath *)indexPath;

- (void)popoverViewCancel:(PGPopoverView *)popoverView;

- (CGFloat)popoverView:(PGPopoverView *)popoverView
   heightForRowAtIndexPath:(NSIndexPath *)indexPath;

- (void)dismissFromParentView:(PGPopoverView *)popoverView;

- (void)okButtonPressed:(NSMutableArray *)mutableArray;

@end

@interface PGPopoverView : UIView <UITableViewDataSource, UITableViewDelegate> {
    UILabel     *_titleView;
    UIControl   *_overlayView;
}

@property (nonatomic, assign) id<PGPopoverViewDataSource> datasource;
@property (nonatomic, assign) id<PGPopoverViewDelegate> delegate;

@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, assign) UIView *parentView;
@property (nonatomic, strong) UIButton *okBtn;

@property (nonatomic, strong) NSMutableArray *selectedIndexArray;

- (void)setTitle:(NSString *)title;

- (void)show;
- (void)dismiss;

- (void)addToParentView;
- (void)addToParentViewFullScreen;
- (void)addToParentViewWithFrame:(CGRect)rect;


@end
